Fix blktap2 test in xen-hotplug-cleanup
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 22 Feb 2010 10:07:27 +0000 (10:07 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 22 Feb 2010 10:07:27 +0000 (10:07 +0000)
commita64e08899bd2768aaebe0bbf2c42fe0d838d4a7a
tree52248cccfc76b8c04bb4a25cbadde46cba16dee4
parentd900060b28494579a305bc43b3ccb4654726a050
Fix blktap2 test in xen-hotplug-cleanup

The blktap2 test in xen-hotplug-cleanup was not quite right, causing
orphaned /vm/<uuid>/device node in xenstore.  Attempt to reattach the
device failed:

xen53: # xm block-attach 0 file:/tmp/d0 /dev/xvdp r
xen53: # xm block-detach 0 /dev/xvdp
xen53: # xenstore-ls /vm/00000000-0000-0000-0000-000000000000/device
vbd =3D ""
 51952 =3D ""
  frontend =3D "/local/domain/0/device/vbd/51952"
  frontend-id =3D "0"
  backend-id =3D "0"
  backend =3D "/local/domain/0/backend/vbd/0/51952"
xen53: # xm block-attach 0 file:/tmp/d0 /dev/xvdp r
Error: Device /dev/xvdp (51952, vbd) is already connected.
Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode>
[BackDomain]

From: Jim Fehlig <jfehlig@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
tools/hotplug/Linux/xen-hotplug-cleanup